unit uniCadTipoCorte;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uniCadPadrao, DB, ADODB, ExtCtrls, Buttons, DBCtrls, StdCtrls,
  Mask;

type
  TfrmCadTipoCorte = class(TfrmCadPadrao)
    lbl1: TLabel;
    lbl2: TLabel;
    dbedtdescricao: TDBEdit;
    dbtxtcd_produto: TDBText;
    procedure dbedtdescricaoEnter(Sender: TObject);
    procedure dbedtdescricaoExit(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    procedure p_Select;
  public
    { Public declarations }
  end;

var
  frmCadTipoCorte: TfrmCadTipoCorte;

implementation

uses uniFuncBD, UniFuncoes;

{$R *.dfm}

{ TfrmCadTipoCorte }

procedure TfrmCadTipoCorte.p_Select;
var sSQL : String;
begin
  sSQL := ' SELECT * FROM TB_TIPO_CORTE WHERE 1=1';
  if sCdCampo <> '' then
    sSQL := sSQL + ' AND cd_tipo_corte LIKE '+QuotedStr(sCdCampo);
  QR_Padrao.Close;
  QR_Padrao.SQL.Clear;
  QR_Padrao.SQL.Add(sSQL);
  QR_Padrao.Open;
  QR_Padrao.First;

end;

procedure TfrmCadTipoCorte.dbedtdescricaoEnter(Sender: TObject);
begin
  inherited;
setCorEnter(Sender);
end;

procedure TfrmCadTipoCorte.dbedtdescricaoExit(Sender: TObject);
begin
  inherited;
  setCorExit(Sender);
end;

procedure TfrmCadTipoCorte.FormShow(Sender: TObject);
begin
  p_Select;    
  inherited;

end;

end.
